home *** CD-ROM | disk | FTP | other *** search
/ Joystick Magazine 1996 May / cd joy 71No13.iso / pc / demos / eurosoc / source / test.cpp < prev    next >
C/C++ Source or Header  |  1996-03-19  |  38KB  |  1,165 lines

  1. #include <iostream.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. #include <graph.h>
  5. #include <i86.h>
  6. #include <dos.h>
  7. #include <conio.h>
  8. #include <float.h>
  9. #include <time.h>
  10. #include <math.h>
  11. #include <string.h>
  12.  
  13. #include "defines.h"
  14. #include "data.equ"
  15. #include "3deng.h"
  16. #include "results.h"
  17. #include "video.h"
  18. #include "intronet.h"
  19. #include "sos.h"
  20. #include "audio.h"
  21. #include "digi.h"
  22. #include "midi.h"
  23. #include "config.h"
  24. #include "timer.h"
  25. #include "mallocx.h"
  26. #include "unmangle.h"
  27. #include "gamedata.h"
  28.  
  29. #include "eurodefs.h"
  30. #include "euro_fxd.h"
  31. #include "euro.equ"
  32. #include "euro_def.h"
  33. #include "euro_var.h"
  34. #include "euro_mem.h"
  35. #include "euro_spt.h"
  36. #include "euro_gen.h"
  37. #include "euro_grf.h"
  38. #include "euro_cnt.h"
  39. #include "euro_dsk.h"
  40. #include "euro_sqd.h"
  41. #include "euro_sel.h"
  42. #include "euro_fix.h"
  43. #include "euro_usr.h"
  44. #include "euro_inf.h"
  45. #include "euro_gdv.h"
  46. #include "euro_win.h"
  47. #include "euro_net.h"
  48. #include "euro_mod.h"
  49. #include "euro_cmd.h"
  50. #include "euro_mat.h"
  51. #include "euro_rnd.h"
  52. #include "euro_sym.h"
  53.  
  54. //…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª 
  55. //∫                                                                                                                              ∫
  56. //∫  EURO '96    -    FRONT END                                                                                          ∫
  57. //∫                                                                                                                              ∫
  58. //∫  Start date:    14/12/1995                                                                                               ∫
  59. //∫  End date:                                                                                     ∫
  60. //∫                                                                                                                              ∫
  61. //∫                                                                                                                              ∫
  62. //∫        Christine's new work number:    2784293                                                                          ∫
  63. //∫             My new mobile number:        0973 868837                                                                      ∫
  64. //∫             Caroline:            0589 665323                                                                      ∫
  65. //∫                                             2446227                                                                          ∫
  66. //∫             Andy Finlay:            2390248                                                                          ∫
  67. //∫             Justin Longden's mobile number: 0973 169931                                                                      ∫
  68. //∫         Philip Durbidge work number:    2734391                                                                          ∫
  69. //∫             Jason Wragg's Home number:    2352544                                                                          ∫
  70. //∫                                                                                                                              ∫
  71. //∫                                                                                                                              ∫
  72. //∫                                                                                                                              ∫
  73. //∫  Changes to formation types:                                                                                                 ∫
  74. //∫                                                                                                                              ∫
  75. //∫      England        4-4-2     done                                                                                           ∫
  76. //∫     Bulgaria    1-3-3-3                                                                                                  ∫
  77. //∫     Croatia        5-3-2     done                                                                                           ∫
  78. //∫     Czech Rep.    5-3-2     done                                                                                           ∫
  79. //∫     Denmark        5-4-1                                                                                                    ∫
  80. //∫     France        4-4-2     done                                                                                           ∫
  81. //∫     Germany        5-3-2     done                                                                                           ∫
  82. //∫     Holland        3-4-3                                                                                                    ∫
  83. //∫     Italy        4-4-2     done                                                                                           ∫
  84. //∫     Portugal    4-5-1                                                                                                    ∫
  85. //∫     Romania        5-4-1                                                                                                    ∫
  86. //∫     Russia        5-3-2     done                                                                                           ∫
  87. //∫     Scotland    5-3-2     done                                                                                           ∫
  88. //∫     Spain        4-5-1                                                                                                    ∫
  89. //∫     Switzerland    4-4-2     done                                                                                           ∫
  90. //∫     Turkey        5-3-2     done                                                                                           ∫
  91. //∫                                                                                                                              ∫
  92. //»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº 
  93.  
  94.     long        SndsValid    =    1;
  95.  
  96.     int        lookv;
  97.     offset_file    load_offsets[256];
  98. //    BYTE        *background_buffer;
  99.     BYTE        *gremlin_buffer;
  100. //    BYTE        *psudo_buffer;
  101.     BYTE        *sprite_buffer;
  102.     BYTE        *sfont_buffer;
  103.     BYTE        *mfont_buffer;
  104.     BYTE        *bfont_buffer;
  105.     BYTE        *spool_buffer;
  106.     BYTE        *unpack_buffer;
  107.     BYTE        *texture_buffer;
  108.     BYTE        *proptab_buffer;
  109.     BYTE         palette_buffer[768];
  110.     BYTE         work_buffer[768];
  111.     extern        unsigned char pal[768];
  112.     BYTE         filter_buffer[256];
  113.     BYTE        mouseBKGbuffer[30*30];
  114.     BYTE        shirtBKGbuffer[51*62];
  115.     short        OldMouseX,OldMouseY,OldMouseWidth,OldMouseHeight;
  116.  
  117.     int        key_velocity        =    0;
  118. // old actua    int        InitialiseMan, InitialiseFlag;
  119.     int        MouseFlags;
  120.     int        Button_pressed        =    0;
  121.     int        VIDEOstatus;
  122.     int        array_test         =    1;
  123.     int        CursorXposn;
  124.     char        wheelgoes        =    0;
  125.     char        redefine_flag        =    255;
  126.     char        CarryControl;
  127.     int        keep_demo_time,keep_demo_Gtype;
  128.     int        keep_demo_teama;
  129.     int        keep_demo_teamb;
  130.     int        keep_x_posn, keep_y_posn;
  131.     int        keep_demo_comp;
  132.     short        keep_demo_offside;
  133.     short        keep_demo_subs;
  134.     short        keep_demo_freekicks;
  135.     short        keep_demo_bookings;
  136.     short        keep_demo_wind;
  137.     int        keep_demo_referee;
  138.  
  139.     char        german_man;
  140.     char        wheel[18]        =    "";
  141.     int        last_menu        =    NULL;
  142.     int        selected_player        =    0;
  143.     int        selected_team        =    0;
  144.     short        selected_formation    =    0;
  145.     short        display_formation      =    selected_formation;
  146.     char        *TextBuffer;
  147.     int        quit            =    NULL;
  148.     int        menu_update        =    NULL;
  149.     char        rerun_menu        =    NULL;
  150.     int        MarkSquadPlayer           =    NULL;
  151.     int        MarkSlotNumber           =    NULL;
  152.     int        MarkControlType           =    NULL;
  153.     int        current_spool            =    NULL;
  154.     int        proportional_change    =    0;
  155.     int        music_state        =    0;
  156.     char        suspend_audio        =    0;
  157.     char        OldKEY            =    0;
  158.     short        OldShirtX,OldShirtY,OldShirtWidth,OldShirtHeight;
  159.     int        ClickXposn,ClickYposn;
  160.     int        ShirtFlags;
  161.     short        ShirtXposn,ShirtYposn;
  162.     char        menu_initialised    =    OFF;
  163.     char        keyboard        =    0;
  164.     int        last_ticks;
  165.     int        resolution,header_y;
  166.     int        firstrun        =    NULL;
  167.     int        NetworkType        =    NULL;
  168.     int        NetworkType_toggle    =    NetworkType;
  169.     int        Competition_limit;  
  170.     int        NoOfTeamsFlag            =    NULL;
  171.     int        Players_Team_Choice;
  172.     short        TabX,lineY;
  173.     int        Lastnetwork        =    -1;
  174.     int        Laststarts        =    -1;
  175.     int        WheelOuter,WheelInner,WindowNumber;
  176.     char        OverlayFlag;
  177. // old actua    int        DrawMan;
  178.     int        formdata;
  179.     int        pulsating_colour    =    0;
  180.     int        formation_toggle;
  181.     char        compute_a,compute_b;
  182.     char        newgame;
  183.     int        music_fade_flag,music_volume;
  184.     int        ref_vision        =    50;
  185.     int        ref_disc        =    50;
  186.     int        ref_vision_add        =    1;
  187.     int        ref_disc_add        =    -1;
  188.     char        GDVavailable,StartGDVavailable;
  189.     char        *time_message; 
  190.     char        *slot_text[25];
  191.     char        *slot_TITLE[25];
  192.     char        RetestNet;
  193.     float        angle    =    -PI/4;    //(3*PI)/4;
  194.     float        anim    =    0.4;
  195.     int         PC_speed    =    34;
  196.     char        tune;
  197.  
  198.     char        cal0,cal1;
  199.     char        which_key_message;
  200.  
  201.     extern    void    write_config_file();
  202.     extern     int      timing();
  203.  
  204.     extern    "C"    signed char key1[6];
  205.     extern    "C"    signed char key2[6];
  206.  
  207.     extern     "C"    volatile int hold_loop;
  208.     extern    "C"    volatile int count;
  209.     extern    "C"    int     netsetup_on;        // In network setup
  210.     extern    "C"     int    network_on;
  211.     extern         char    return_doskey;
  212.  
  213.     extern         match(int argc, char **argv);
  214.     extern    "C"    int    CheckFORnet();
  215.     extern    "C"    void    DeinitialiseNET(int netflag);
  216.     extern char    audio_version;
  217.     extern void    claim_key_int(void);
  218.     extern void    release_key_int(void);
  219.     int        go_audio();
  220.     char        team_a_okay, team_b_okay;
  221.     extern void    init_keyboard();
  222.     extern void     init_users();
  223.     extern void     init_team();
  224.     extern    "C"    volatile char net_half;
  225.     extern "C"     char joystick1_on;
  226.     extern "C"     char joystick2_on;
  227.     extern "C"     unsigned short joy1_cnt_x,joy1_cnt_y;
  228.     extern "C"     unsigned short joy2_cnt_x,joy2_cnt_y;
  229.     extern "C"     char old_mf;
  230.  
  231.     int    new_menu, current_menu;
  232.     char        lastTGAstate;
  233.     int        AutoSTARTgame;
  234.     int        RESET_MEMORY;
  235.     int        bomb_message    =    NULL;
  236.     char        force_res;
  237.     char        sub_version;
  238.  
  239.         short        GDVtimer;
  240.     int __far    criticalhandler(unsigned deverror,unsigned errcode, unsigned __far * devhdr);
  241.     int        GetFirstCDDrive();
  242.     int         CheckCD(int CD);
  243.     char        no_cd;
  244.     char        keep_language;
  245.     int        InsertKey(int SourceKEY);
  246.  
  247.     extern    int    gdv_gran;
  248.     extern  "C"    int    x1ok;
  249.     extern  "C"    int    y1ok;
  250.     extern  "C"    int    x2ok;
  251.     extern  "C"    int    y2ok;
  252.     extern  "C"    int    bitaccept;
  253.  
  254.     extern    void     PlayGDV();
  255.     char    testfile[128];
  256.  
  257.  
  258.  
  259. //…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª 
  260. //∫                                                                                                                              ∫
  261. //∫  Euro '96 addition.                                                                                                          ∫
  262. //∫                                                                                 ∫
  263. //»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº 
  264.  
  265.     extern    int      testVESA;
  266.     extern    int       VESAmode(int *);
  267.     extern  void near svgacpy( char unsigned near *, short, short, short, short, short );
  268.  
  269.  
  270. void    main(int argc, char **argv)
  271. {
  272.     version        =    1;
  273.     sub_version    =    0;
  274.     day        =    15;
  275.     month         =    12;
  276.     year          =    1995;
  277.     EUROsymbol    =    0;
  278.     EUROfrontend    =    1;
  279.  
  280.     printf    ("\n\n\n\nEURO '96\n");
  281.     fflush(stdout);
  282.     printf    ("\(C\) Gremlin Interactive 1995,96\n");
  283.     fflush(stdout);
  284.     printf    ("˛ Version: %d.%d         %d/%d/%d\n", version, sub_version, day, month, year);
  285.     fflush(stdout);
  286.  
  287.     TestForWindows95();
  288.     Test_640x480_VideoMode();
  289.  
  290.     LogicState    =    BLANK_SCREEN;
  291.     Team        =    England;
  292.     Menu        =    MAIN;
  293.     NoOfSubs    =    4;
  294.     UsableSubs    =    4;
  295.  
  296.     WinPts        =    3;
  297.     DrawPts        =    1;
  298.     MatchNumber    =    0;
  299.       ChangeMenu     =        -2;
  300.     EUROday        =    2;
  301.     EUROmonth    =    2;
  302.     EUROyear    =    96;
  303.     EUROgameType    =    EURO_championship;    //friendly;
  304.  
  305.     EUROteamA    =    0;    //England;
  306.     EUROteamB    =    1;    //Scotland;
  307.     EUROteamView    =    0;
  308.  
  309.     ResetUsers();
  310.     EUROnoOfMatchPlyrs =    1;
  311.     EUROplyrSetup    =    0;
  312.     CommPort    =    2;
  313.     BaudRate    =    9600;
  314.     RunMatch    =    No;
  315.  
  316.  
  317.     ProcessCommandLine( argc, argv);
  318.  
  319.     if ( EUROverbose != 0 )
  320.     {
  321.         printf ("˛ Memory check: %d\n",get_mem_info() );
  322.         fflush(stdout);
  323.     }
  324.  
  325.     EUROmaxPlayers    =      SetupControlMethods();
  326.  
  327.  
  328.     InitEUROnet();
  329.     if ( EUROnetInitialise == No && EUROgameType == EURO_network_game )
  330.         EUROgameType = EURO_friendly;
  331.  
  332. //********************************************************************************************************************************
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345. //…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª 
  346. //∫                                                                                                                              ∫
  347. //∫  Checks to see make sure a mouse driver is present before continuing.                                                        ∫
  348. //∫                                                                                 ∫
  349. //»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº 
  350.  
  351.     bomb_message    =    0;
  352.  
  353.     _harderr(criticalhandler);
  354.     GetFirstCDDrive();
  355.  
  356.  
  357. //********************************************************************************************************************************
  358.  
  359. //…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª 
  360. //∫                                                                                                                              ∫
  361. //∫  Euro '96 addition.                                                                                                          ∫
  362. //∫                                                                                 ∫
  363. //»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº 
  364.  
  365.         ReadDataOffsetFile( &EuroOFFSETfile[0] );        // Load data offset file. 
  366.  
  367.         Euro96_MemoryInitialise();                // Resets all Euro memory handles.
  368.  
  369.         TextStringMemHandle  =                    // Set up memory handle.
  370.             AllocateTextStringMemory();            // Allocate memory for text strings..
  371.  
  372.         printf    ("˛ %d Bytes allocated for script file text.\n", TEXT_STRING_BUFFER_LEN);
  373.         fflush(stdout);
  374.  
  375.     // ------------------------------------
  376.  
  377.  
  378.         if ( EUROsymbol == 1 )
  379.         {
  380.             fp2=fopen( "euro_sym.h", "wb" );
  381.                 if(fp2==NULL)
  382.                 {
  383.                     EUROsymbol = 0;
  384.                     printf    ("˛ Error trying to create symbol table.\n");
  385.                     fflush(stdout);
  386.                 }
  387.         }
  388.  
  389.         process_script_file(&EuroSCRIPTfile[0]);        // Reads script file and compiles relevent data for game.
  390.  
  391.         if ( EUROsymbol == 1 )
  392.         {
  393.             fclose(fp2);                        
  394.              printf    ("˛ Symbol table created.\n");
  395.             fflush(stdout);
  396.             DeAllocateMemory(TextStringMemHandle);            // DeAllocates memory used previously for text strings.
  397.             exit(-1);
  398.         }                
  399.  
  400.     // ------------------------------------
  401.  
  402.         if ( EUROgameType == EURO_wireplay )
  403.         {
  404.             printf    ("˛ Wireplay Teams:    %s  V",
  405.                 GetTEAMname( EUROteamA, 11 ) );
  406.             fflush(stdout);
  407.             printf    ("  %s\n",
  408.                 GetTEAMname( EUROteamB, 11 ) );
  409.             fflush(stdout);
  410.         }
  411.  
  412.         AllocateDisplayBuffers();                     // Allocates two 640x480 display buffers.
  413.  
  414.         TexturePageMemHandle =                    // Set up memory handle.
  415.             AllocateTexturePageMemory( 8,             // Specify number of texture pages to allocate.
  416.                 &FrontendTextureDEFN );            // Allocate memory for frontend texture pages.
  417.  
  418.         FrontendTextureDEFN.page_start     = (BYTE *)TexturePages;    // Specify memory address used for texture pages.
  419.  
  420.         LoadTexturePage( BIN_PAGE1,                        // Load texture page 1 into texture memory.
  421.                  &EuroDATfile[0], 
  422.                  0, &FrontendTextureDEFN );
  423.  
  424.         LoadPalette( BIN_TSELPAL, &EuroDATfile[0], 0 );        // creates special filters for team select section.
  425.                  CreateFilter( &FilterBuffer[256],  40, 54, 60, .7, .7, .7);
  426.                  CreateFilter( &FilterBuffer[512],  40, 54, 60, .6, .6, .6);
  427.                  CreateFilter( &FilterBuffer[768],  40, 54, 60, .5, .5, .5);
  428.                  CreateFilter( &FilterBuffer[1024], 40, 54, 60, .4, .4, .4);
  429.                  CreateFilter( &FilterBuffer[1280], 40, 54, 60, .3, .3, .3);
  430.                  CreateFilter( &FilterBuffer[1536], 40, 54, 60, .2, .2, .2);
  431.                  CreateFilter( &FilterBuffer[1792], 40, 54, 60, .1, .1, .1);
  432.  
  433. //********************************************************************************************************************************
  434.         
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462. //…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª 
  463. //∫                                                                                                                              ∫
  464. //∫  Checks command line for verbose options.                                                                                    ∫
  465. //∫                                                                                 ∫
  466. //»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº 
  467.         
  468.         if(ReadConfigFile())
  469.             bomb_message|=    CONFIG_ERROR;
  470.  
  471.         match_info.menu_res      =       HI;
  472.         batch_info.GDVres    =    HI;
  473.         newgame            =    0;
  474.         redefine_flag         =    255;
  475.         CarryControl        =    NULL;
  476.         x1ok            =    NULL;    
  477.         y1ok            =    NULL;    
  478.         x2ok            =    NULL;
  479.         y2ok            =    NULL;    
  480.         bitaccept        =    NULL; 
  481.         match_info.tga_enable     =    NULL;
  482.         batch_info.cheat_mode     =    OFF;
  483.         match_info.menu_res      =       HI;
  484.         force_res           =    NULL;
  485.         match_info.language     =    Language;
  486.         no_cd            =    FALSE;
  487. //        batch_info.floppy      =      FLOPPY;
  488.         keyboard        =    0;
  489.  
  490.         batch_info.rolling_demo    =    ROLLING_DEMO;
  491.  
  492.         if (batch_info.rolling_demo!=Off)
  493.             no_cd        =    TRUE;
  494.  
  495. //…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª 
  496. //∫                                                                                                                              ∫
  497. //∫  Checks for PC memory and machine speed then sets up game and intro variables.                                               ∫
  498. //∫                                                                                 ∫
  499. //»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº 
  500.  
  501.         setup.detail.sky         =    ON;    
  502.         setup.detail.stadia      =    HI;
  503.         setup.detail.lines       =    ON;
  504.         setup.vidi_type          =    HI;
  505.         setup.detail.players     =    HI;
  506.         setup.detail.pitch       =    MED;
  507.         setup.start_res      =    LO;
  508.         setup.screen_size       =    NULL;
  509.         setup.stadium             =     1;
  510.  
  511.         PC_speed        =    timing();
  512.         setup.M8        =    1;    //DisplayFree();
  513.  
  514.         if (PC_speed>31)
  515.             PC_speed = 31; 
  516.         setup.detail.sky     =        detail_defaults[PC_speed].sky;    
  517.         setup.detail.stadia  =        detail_defaults[PC_speed].stadia;
  518.         setup.detail.pitch   =        detail_defaults[PC_speed].pitch;
  519.         setup.detail.players =        detail_defaults[PC_speed].players;
  520.         setup.detail.lines   =        detail_defaults[PC_speed].lines;
  521.         setup.detail.shadows =        detail_defaults[PC_speed].shadows;
  522.         setup.vidi_type      =        NULL;
  523.         setup.start_res      =        NULL;
  524.         match_info.camera    =        NULL;
  525.         setup.screen_size    =        screen_defaults[PC_speed];
  526.  
  527.         music_fade_flag                  =    NULL;            
  528.          match_info.music            =    NULL;
  529.         match_info.crowd            =    NULL;
  530.         match_info.commentary            =    NULL;
  531.         match_info.master            =    NULL;
  532.         match_info.pitch            =    NULL;
  533.  
  534.         match_info.referee            =    16+16;
  535.         match_info.CompetitionType        =    FRIENDLY;
  536.         match_info.CompetitionType_toggle    =    FRIENDLY;
  537.         match_info.NoOfPlayers            =    NULL;
  538.         match_info.NoOfPlayers_toggle        =    NULL;
  539.         
  540.         if (batch_info.rolling_demo==Off)
  541.         {
  542.             match_info.GameType            =    SIMULATION;
  543.             match_info.GameType_toggle        =    SIMULATION;
  544.         }            
  545.         else
  546.         {
  547.             match_info.GameType            =    ARCADE;
  548.             match_info.GameType_toggle        =    ARCADE;
  549.         }            
  550.         batch_info.Port_toggle            =    NULL;
  551.         match_info.control_methods[0]        =    0;
  552.         match_info.control_methods[1]        =    1;
  553.         match_info.control_methods[2]        =    2;
  554.         match_info.control_methods[3]        =    3;
  555.  
  556.         match_info.time                =    0;
  557.         match_info.time_toggle             =    match_info.time;
  558.         net_half                =    match_info.time;
  559.         match_info.offside            =    0;
  560.         match_info.offside_toggle        =    0;
  561.         match_info.substitutes            =    1;
  562.         match_info.substitutes_toggle        =    1;
  563.         match_info.bookings            =    1;
  564.         match_info.bookings_toggle         =    1;
  565.         match_info.wind                =    0;
  566.         match_info.wind_toggle            =    0;
  567.         match_info.freekicks            =    1;
  568.         match_info.freekicks_toggle          =    1;
  569.         
  570.         batch_info.match_number            =    -1;
  571.         batch_info.round_up_page        =    0;
  572.         batch_info.cup_match_number        =    -1;
  573.         batch_info.number_of_cup_teams        =    32;
  574.  
  575.         batch_info.keys_used[UP_RED]        =    0x1e;        // A
  576.         batch_info.keys_used[DN_RED]        =    0x2c;        // Z
  577.         batch_info.keys_used[LF_RED]        =    0x33;        // <
  578.         batch_info.keys_used[RT_RED]        =    0x34;        // >
  579.         batch_info.keys_used[F1_RED]        =    0x10;        // Q
  580.         batch_info.keys_used[F2_RED]        =    0x35;        // /
  581.  
  582.         batch_info.keys_used[UP_RED+6]        =    -0x48;        // Arrow Up
  583.         batch_info.keys_used[DN_RED+6]        =    -0x50;        // Arrow Dn
  584.         batch_info.keys_used[LF_RED+6]        =    -0x4b;        // Arrow Lf
  585.         batch_info.keys_used[RT_RED+6]        =    -0x4d;        // Arrow Rt
  586.         batch_info.keys_used[F1_RED+6]         =    0x52;        // 0(num)
  587.         batch_info.keys_used[F2_RED+6]         =    0x53;        // .(num)
  588.                     
  589.         cal0                    =    NULL;
  590.         cal1                    =    NULL;
  591.         net_game_no                =    0;
  592.         cd_in                    =    TRUE;
  593.         suspend_audio                =    0;
  594.  
  595.         reset_league_teams();
  596.  
  597.  
  598.  
  599. //…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª 
  600. //∫                                                                                                                              ∫
  601. //∫  Load DATA.DAT file offset table.                                                                                            ∫
  602. //∫                                                                                 ∫
  603. //»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº 
  604. //
  605. //            // The following lines check to see if DATA.DAT and DATA.OFF files are on C:
  606.  
  607.         audio_version=TRUE; 
  608.         InitialiseTimer();            // Initialise timers for sound drivers    (see ANDY or LAURENT)..
  609.  
  610.             if (go_audio())
  611.             {
  612.                 UnInitialiseTimer();
  613.                 bomb_message|=    SOUND_ERROR;
  614.             }
  615.  
  616.         // Timer stuff
  617.  
  618.         ftick        =    0;
  619.         tick        =    0;
  620.         count        =    0;
  621.         game_speed    =    REAL_SPEED;
  622.         readptr=writeptr=    0;
  623.  
  624.         AddTimer(TIMER_SPEED,nethandler,NetworkHandle);
  625.         AddTimer( 63, EUROinterupt, EuroHandle );
  626.                        
  627.         claim_key_int();
  628.  
  629.     //----------------------------------------------------------------------------------------------
  630.  
  631.         Set_palette_to_black();
  632.  
  633.         RESET_MEMORY    =    YES;
  634.         OverlayFlag    =    NULL;
  635.  
  636.         if (newgame==0)
  637.  
  638.     while    ( new_menu!=QUIT && new_menu!=NO_MOUSE )
  639.     {
  640.         return_doskey     =    FALSE;
  641.  
  642.         if ( RESET_MEMORY==YES )
  643.         {
  644.             Set_palette_to_black();
  645.  
  646. // old actua                 Initialise_environment();
  647. // old actua            Allocate_memory();
  648. // OLD ACTUA            mbuff.buff_start    =    (BYTE *)psudo_buffer-4-60;    
  649. // old actua            sbuff.buff_start    =    (BYTE *)psudo_buffer-4-60;    
  650.  
  651. //********************************************************************************************************************************
  652.  
  653. //…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª 
  654. //∫                                                                                                                              ∫
  655. //∫  Euro '96 addition.                                                                                                          ∫
  656. //∫                                                                                 ∫
  657. //»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº 
  658.  
  659. //        InitialiseSquadPositions();
  660.         FrontendBackgroundDEFN.pseudo_start     =    (BYTE *)EuroBackgroundBuffer;
  661.         FrontendPseudoDEFN.pseudo_start     =    (BYTE *)EuroPseudoBuffer;
  662.         Set_640x480_VideoMode();
  663.         Set_palette_to_black();
  664.  
  665. //********************************************************************************************************************************
  666.  
  667.             suspend_audio     =    0;
  668.             memset( palette_buffer, 0, 768 );
  669.             memset( work_buffer, 0, 768 );
  670.             RESET_MEMORY    =    NO;
  671.         }    
  672.  
  673.     batch_info.PointsForWin    =    3;
  674.  
  675.  
  676.     last_ticks    =    NULL;
  677.     AutoSTARTgame     =    NULL;
  678.     suspend_audio    =    0;
  679.     RetestNet    =    FALSE;
  680.  
  681. //********************************************************************************************************************************
  682.  
  683. //…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª 
  684. //∫                                                                                                                              ∫
  685. //∫  Euro '96 addition.                                                                                                          ∫
  686. //∫                                                                                 ∫
  687. //»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº 
  688. //
  689.         EUROoveride    =    0;
  690.  
  691.     if ( EUROgameType == EURO_wireplay ) 
  692.     {
  693.         StartingEURO_96( EUROgameType );
  694.         Euro96initialise();    // Initialise game data.
  695.          EUROuserSelection    =  0;
  696.         Menu            =  PLAYER_SETUP;
  697.         EURO_Did_I_ChooseTeams    =  Yes;     // you made team choice.
  698.         Team_A            =  EUROteamA;   // Send your choice of teams.
  699.         Team_B            =  EUROteamB;     // Send your choice of teams.
  700.         SendTeamInfo();
  701.         TickPause();
  702.         TickPause();
  703.         TickPause();
  704.         EURO_NetSelectionMade    =  No;        // player selection has not yet been made.
  705.          }
  706.  
  707. //********************************************************************************************************************************
  708.  
  709.  
  710.  
  711.  
  712.     
  713.  
  714.  
  715.     while    ( new_menu!=QUIT )
  716. //    while   ( ChangeMenu!=EXIT_FRONTEND && LogicState!=BLANK_SCREEN )    // new loop.
  717.     {
  718.  
  719.         ClearDumpList();
  720.         hold_loop    =    NULL;
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.         while    (current_menu==new_menu)
  728.             {
  729.             do
  730.         {
  731.         } while    (count<TIMER_SPEED/30);
  732.  
  733.         count    =    0;
  734.  
  735. //***********************   NEW EURO '96 FRONTEND LOOP   *************************************************************************
  736.  
  737. //…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª 
  738. //∫                                                                                                                              ∫
  739. //∫  Euro '96 addition.                                                                                                          ∫
  740. //∫                                                                                 ∫
  741. //»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº 
  742.  
  743.         unsigned short    r = GetRnd2();
  744.  
  745.         if ( LogicState == BLANK_SCREEN && ChangeMenu == -2 )
  746.         {
  747.             OVERRIDEpal1    =    15;
  748.             OVERRIDEpal2    =    29;
  749.             ResetAnimations();
  750.             ResetBoundingBoxes();
  751.             SetupExtraTexturePages( Menu );
  752.             DisplayBackground( Menu );
  753.             OverlayStaticBackgroundImages( Menu );
  754.             memcpy( EuroPseudoBuffer, EuroBackgroundBuffer, 307200 );
  755.             InitialiseMenuPage( Menu );
  756.             svgacpy( (unsigned char *) EuroPseudoBuffer, 0, 0, 640, 480, 640);
  757.             EuroTextEditState = 0;
  758.             ChangeMenu =    -1;    
  759.             LogicState = PALETTE_FADEUP;
  760.             Finish       =    0;
  761.         }        
  762.  
  763.         GetConsoleInput();
  764.         ControlAnimations();
  765.  
  766.         Bounding_box = GetBoundingBox( SelectorXcoord, SelectorYcoord );
  767.         DoMainScreen( Menu );
  768.                DoSquadSelection( Menu, Bounding_box, SelectorXcoord, SelectorYcoord );
  769.                DoTeamSelection( Menu, Bounding_box );
  770.                DoUserSetup( Menu, Bounding_box );
  771.                DoModemSetup( Menu, Bounding_box );
  772.         DoNextMatchSelection( Menu, Bounding_box );
  773.         EuroReDraw( Menu, Bounding_box );
  774.         GroupFixturesPage( Menu, Bounding_box );
  775.         DoPlayerStats( Menu, Bounding_box, SelectorXcoord, SelectorYcoord );
  776.         DoTeamStats( Menu, Bounding_box, SelectorXcoord, SelectorYcoord );
  777.         DoFinalRoundFixtures( Menu, Bounding_box );
  778.  
  779.         if ( EuroTextEditState == 0 )
  780.         {
  781.             StorePSEUDObuffer( &FrontendPseudoDEFN, &FrontendTextureDEFN, MOUSE_STOREbuff, SelectorXcoord, SelectorYcoord );
  782.             DrawIMAGE(  &FrontendPseudoDEFN, &FrontendTextureDEFN, MOUSEimages+NoButton, 
  783.                     SelectorXcoord, SelectorYcoord, NO_BOX, spritecopy );
  784.             AddToDumpList( SelectorXcoord, SelectorYcoord, Image_Widths[MOUSEimages+NoButton], Image_Heights[MOUSEimages+NoButton] );
  785.         }            
  786.  
  787.             CopyDumpListToScreen();                 
  788.  
  789.         if ( EuroTextEditState == 0 )
  790.         {
  791.                    DrawIMAGE( &FrontendPseudoDEFN, &FrontendTextureDEFN, MOUSE_STOREbuff, 
  792.                     SelectorXcoord, SelectorYcoord, NO_BOX, straightcopy );
  793.             AddToDumpList( SelectorXcoord, SelectorYcoord, Image_Widths[MOUSEimages+NoButton], Image_Heights[MOUSEimages+NoButton] );
  794.         }
  795.  
  796.         ReplaceSquadBuffers( Menu );
  797. //        DoStadiumFlythru( Menu );
  798.  
  799.         if ( ChangeMenu != -1 && ChangeMenu < 63 )
  800.             {
  801.                   {
  802.                       LogicState = PALETTE_FADEDOWN;
  803.                 ChangeMenu|=    64;
  804.                   }
  805.             }
  806.         
  807.                if ( ChangeMenu >= 64 && LogicState == BLANK_SCREEN )
  808.             {
  809.                 if (EUROgameType==EURO_network_game && (ChangeMenu & 63)==TEAM_SELECT &&
  810.                          HaveNETteamsBeenChosen() == Yes )
  811.                     Menu    =    PLAYER_SETUP;
  812.                 else                    
  813.                     Menu        =    ChangeMenu & 63;
  814.                 ChangeMenu    =    -2;
  815.  
  816.                 if ( RunMatch == Yes )
  817.                     PlayMatch( argc, argv );
  818.             }            
  819.  
  820.         
  821. //*** TEMPORY EXIT TO DOS ********************************************************************************************************
  822.  
  823.         if ( LogicState == RUN_FRONTEND )
  824.         {
  825.  
  826.                if (keys[2])
  827.                 TeamOveride    =    1;
  828.                if (keys[0x3b])
  829.                   {
  830.                       ChangeMenu = EXIT_FRONTEND;
  831.                         LogicState = PALETTE_FADEDOWN;
  832.                   }
  833.         }
  834.  
  835.         if ( ChangeMenu == EXIT_FRONTEND && LogicState == BLANK_SCREEN )
  836.         {
  837.               new_menu     =     QUIT;
  838.         }
  839.  
  840. //********************************************************************************************************************************
  841.  
  842.         hold_loop    =    NULL;
  843.  
  844.         }
  845.  
  846.     current_menu    =    new_menu;
  847.     rerun_menu        =    NULL;
  848.  
  849.     }
  850.  
  851.     }
  852.  
  853. MAJOR_ERROR:;
  854.  
  855.     if (new_menu==QUIT)
  856.     {    
  857.         UnInitEUROnet();    
  858.  
  859. // old actua     DeinitialiseNET(Competition_limit);            // net game can be played.....
  860.  
  861.     release_key_int();
  862.     RemoveTimer(EuroHandle);
  863.     RemoveTimer(NetworkHandle);
  864.  
  865.     if (audio_version)
  866.     {
  867.         UnInitialiseDIGI();    // Uninitialise SOS
  868.  
  869.             if ( batch_info.floppy==YES )
  870.             UnInitialiseMIDI();    
  871.     }
  872.  
  873.     UnInitialiseTimer();
  874.      UnInitEUROnet();    
  875.  
  876. // old actua        DeinitialiseNET(Competition_limit);            // net game can be played.....
  877.  
  878.         union REGS r;
  879.         r.x.eax = 0x0003;
  880.         int386(0x10, &r, &r);
  881.     }
  882.  
  883.  
  884.  
  885.  
  886.  
  887. //********************************************************************************************************************************
  888.  
  889. //…ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª 
  890. //∫                                                                                                                              ∫
  891. //∫  Euro '96 addition.                                                                                                          ∫
  892. //∫                                                                                 ∫
  893. //»ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº 
  894.  
  895.          if ( EUROverbose != 0 )
  896.          {
  897.             printf("\n  DEALLOCATING MEMORY BEFORE EXITING TO DOS.\n\n");
  898.             fflush(stdout);                
  899.         }
  900.  
  901.         DeAllocateTexturePages();
  902.         DeAllocateDisplayBuffers();
  903.         DeAllocateMemory(TextStringMemHandle);            // DeAllocates memory used previously for text strings.
  904.  
  905. //********************************************************************************************************************************
  906.  
  907. //        if ((bomb_message & MOUSE_ERROR)!=0)
  908. //            printf ( GetText(MOUSE_ERROR_TEXT) );
  909. //        if ((bomb_message & SOUND_ERROR)!=0)
  910. //            printf ( GetText(SOUND_ERROR_TEXT) );
  911. //        if ((bomb_message & CONFIG_ERROR)!=0)
  912. //            printf ( GetText(CONFG_ERROR_TEXT) );
  913. //        if ((bomb_message & FILE_ERROR)!=0)
  914. //            printf ( GetText(DFILE_ERROR_TEXT) );
  915. //        if ((bomb_message & FILE_MISSING)!=0)
  916. //            printf ( GetText(MFILE_ERROR_TEXT) );
  917. //        if ((bomb_message & MATCH_ERROR)!=0)
  918. //            printf ( GetText(INI3d_ERROR_TEXT) );
  919. //        if ((bomb_message & MEMORY_PROBLEM)!=0)
  920. //            printf ( GetText(MEMOY_ERROR_TEXT) );
  921. //        if ((bomb_message & WHEEL_ERROR)!=0)
  922. //            printf ( GetText(WHEEL_ERROR_TEXT) );
  923.  
  924. }
  925.  
  926.  
  927.  
  928. /******************************************************************************
  929. *****************************************************************************/
  930.  
  931. int go_audio()
  932. {
  933. // Initialise Audio Config...
  934.     
  935.  
  936.         if ( batch_info.floppy==YES )
  937.     {
  938.         if(InitialiseMIDI())    
  939.             return(EXIT_FAILURE);
  940.     }
  941.  
  942.     if(InitialiseDIGI(22050,setup.verbose?IDF_VERBOSE:0))            // Initialise Digital Sound Drivers
  943.     {
  944.             if ( batch_info.floppy==YES )
  945.             UnInitialiseMIDI();    
  946.  
  947.         return(EXIT_FAILURE);
  948.     }
  949.  
  950.  
  951.  
  952.     return(FALSE);
  953. }
  954.  
  955. /******************************************************************************
  956. ******************************************************************************/
  957.  
  958. //
  959. // Software Piracy Protection Pumpkin Gobbler for ACTUA SOCCER
  960. //
  961.  
  962.     int NumCDdrives;
  963.     int FirstCDdrive;
  964.     int file=0;
  965.  
  966. //*************************************************************************************************
  967. //
  968. // Checks for the Actua Soccer CD
  969. //
  970. //*************************************************************************************************
  971. int CDPresent()
  972. {
  973.     if ( batch_info.floppy==NO )
  974.     {
  975.  
  976.         int i=0;
  977.         int CDfound=0;
  978.             for(i=0;i<NumCDdrives;i++)
  979.                 if(!CDfound)
  980.                     CDfound=CheckCD(FirstCDdrive+i);
  981.             return(CDfound);
  982.     }
  983.  
  984.     else
  985.             return(1);    // using floppy version.
  986. }
  987.  
  988. //*************************************************************************************************
  989. //
  990. // Checks to see if there is a CD Drive connected.
  991. //
  992. // returns TRUE if CD Connected and fills in First CD Drive and NumCDdrives
  993. //            FALSE if nothing there
  994. //
  995. //*************************************************************************************************
  996. int GetFirstCDDrive()
  997. {
  998.     int    drive;
  999.     union REGS regs;
  1000.     
  1001.     regs.w.ax=0x1423;
  1002.     regs.w.ax+=0xdd;            // 0x1500
  1003.     regs.w.bx=0;
  1004.     int386(0x2f,®s,®s);
  1005.  
  1006.     if(regs.w.bx)
  1007.         {
  1008.         drive = (char)regs.w.cx;
  1009.         FirstCDdrive=drive;
  1010.         NumCDdrives=regs.w.bx;
  1011.         return(0);
  1012.         }
  1013.     else
  1014.         return(1);
  1015. }
  1016.  
  1017. //*************************************************************************************************
  1018. //
  1019. // Check for a single file on a drive
  1020. //
  1021. //*************************************************************************************************
  1022. int CheckCD(int CD)
  1023. {
  1024.     char filename[16];
  1025.     FILE *fp;
  1026.  
  1027.     filename[0]=CD+'A';                        //check the last one we new about
  1028.     file^=1;
  1029.  
  1030.  
  1031.     if (match_info.language==English || match_info.language==French || match_info.language==Norwegian)
  1032.         strcpy(filename+1,file?":\\ACTREND.DAT":":\\DATA.DAT");
  1033.  
  1034.     if (match_info.language==German)
  1035.         strcpy(filename+1,file?":\\ACTREND.DAT":":\\RANDATA.DAT");
  1036.  
  1037.     if (match_info.language==American || match_info.language==Canadian)
  1038.         strcpy(filename+1,file?":\\ACTREND.DAT":":\\VRDATA.DAT");
  1039.  
  1040.     if(fp=fopen(filename,"rb"))
  1041.         {
  1042.         fread(&filename[0],1,16,fp);
  1043.         fclose(fp);
  1044.         return(1);
  1045.         }
  1046.     else
  1047.         return(0);
  1048. }
  1049.  
  1050. //*************************************************************************************************
  1051. //
  1052. // Critical Error Handle for Disk Errors
  1053. //
  1054. //*************************************************************************************************
  1055. int __far    criticalhandler(unsigned deverror,unsigned errcode, unsigned __far * devhdr)
  1056. {
  1057.     return(_HARDERR_FAIL);
  1058. }
  1059.  
  1060.  
  1061. int    InsertKey(int SourceKEY)
  1062. {
  1063.      if (SourceKEY>127)
  1064.     {
  1065.          SourceKEY-=    128;
  1066.         SourceKEY=    -SourceKEY;
  1067.     }
  1068.     return    (SourceKEY);
  1069. }
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080. //void    SearchForVIDEOmode()
  1081. //{
  1082. //    char    testgdv[128];
  1083. //    strcpy    (testgdv,SourcePath);
  1084. //    strcat    (testgdv,"\\VIDEO\\swhole_s.gdv");
  1085. //    GDVavailable        =    DoesFILEexist(testgdv);
  1086. //    if (match_info.language==German)
  1087. //        GDVavailable        =    1;
  1088. //    strcpy    (testgdv,SourcePath);
  1089. //    if (match_info.language==English || match_info.language==French || match_info.language==Norwegian)
  1090. //        strcat    (testgdv,"\\VIDEO\\sfull_s.gdv");
  1091. //    if (match_info.language==German)
  1092. //        strcat    (testgdv,"\\VIDEO\\dssintro.gdv");
  1093. //    if (match_info.language==American || match_info.language==Canadian)
  1094. //        strcat    (testgdv,"\\VIDEO\\sfull_s.gdv");
  1095. //
  1096. //    StartGDVavailable    =    1;    //DoesFILEexist(testgdv);    
  1097. //
  1098. //        if (StartGDVavailable==0 || batch_info.GDVres==LO)
  1099. //        {
  1100. //            strcpy    (testgdv,DestinationPath);
  1101. //
  1102. //            if (match_info.language==English || match_info.language==French || match_info.language==Norwegian)
  1103. //                strcat    (testgdv,"\\VIDEO\\vfull_s.gdv");
  1104. //            if (match_info.language==German)
  1105. //                strcat    (testgdv,"\\VIDEO\\dvsintro.gdv");
  1106. //            if (match_info.language==American || match_info.language==Canadian)
  1107. //                strcat    (testgdv,"\\VIDEO\\vfull_s.gdv");
  1108. //
  1109. //            StartGDVavailable    =    DoesFILEexist(testgdv);    
  1110. //
  1111. //
  1112. //                if (StartGDVavailable==0 && batch_info.floppy==NO)
  1113. //                    bomb_message|=    FILE_MISSING;
  1114. //        }
  1115. //
  1116. //        if ( setup.verbose!=NULL && GDVavailable==NULL)
  1117. //            printf    ("THE MAKING OF ACTUA MOVIE IS MISSING FROM SOURCE PATH...\n");
  1118. //        if ( setup.verbose!=NULL && StartGDVavailable==NULL)
  1119. //            printf    ("THE ACTUA INTRO GDV IS MISSING FROM SOURCE PATH...\n");
  1120. //
  1121. //
  1122. //
  1123. //
  1124. //
  1125. //
  1126. //        DisplayWidth    =    640;
  1127. //    
  1128. //    // checks for GDV mode, only if GDV is on CD.
  1129. //            
  1130. //               if (GDVavailable!=NULL)
  1131. //            {
  1132. //            testVESA        =    1;    
  1133. //            VIDEOstatus         =    VESAmode( &GDVvidmode[0] );
  1134. //            }
  1135. //
  1136. ////        if (VIDEOstatus==-1 || GDVavailable==NULL)
  1137. ////            batch_info.GDVres=LO;
  1138. //
  1139. //    // setup the video mode, mode 101 (640x480).
  1140. //
  1141. //        testVESA        =    1;    
  1142. //        VIDEOstatus         =    VESAmode( &MENUvidmode[0] );
  1143. //                                        
  1144. //            if (VIDEOstatus == -1)
  1145. //                match_info.menu_res=LO;
  1146. //}
  1147.  
  1148. //void    InitialiseCodeWheel()
  1149. //{
  1150. //    CursorXposn    =    0;
  1151. //     WheelOuter    =    (Random_RS()&15);
  1152. //     WheelInner    =    (Random_RS()&15);
  1153. //     WindowNumber    =    (Random_RS()&31);
  1154. //    wheelgoes++;
  1155. //    
  1156. //    char    legal_manual    =    FALSE;
  1157. //
  1158. //     while    ( legal_manual==FALSE )
  1159. //    {    
  1160. //      german_man    =    (Random_RS()&63);
  1161. //        if  ( german_man<50 )
  1162. //          legal_manual    =    TRUE;
  1163. //    }
  1164. //}
  1165.